import java.util.Scanner;

//求一个数在内存中二进制1的个数
public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        int i=1;
        int cnt=0;
        while(i<=32){
            if((n&1)==1){
                cnt++;
            }
            n>>=1;
            i++;
        }
        System.out.println(cnt);
    }
}

//计算交叉分数段和
class Test2 {
    public static void main(String[] args) {
        int flag=1;
        float sum=0f;
        //法二
        for (int i = 1; i <= 100 ; i++) {
            sum+=flag*(1.0/i);
            flag*=-1;
        }
        //法一
        for (int i = 1; i <= 100; i++) {
            if(i%2==0){
                sum-=1.0/i;
            }
            else{
                sum+=1.0/i;
            }
        }
        System.out.println(sum);
    }
}

//水仙花数
class Test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        for (int i = 0; i <= n; i++) {
            if(i>=0 && i<=9){
                System.out.println(i);
            } else if (i>9) {
                int x=i;
                int sum=0;
                int count=0;
                while(x!=0){
                    x/=10;
                    count++;
                }
                x=i;
                while(x!=0){
                    sum+=Math.pow(x%10,count);
                    x/=10;
                }
                if(sum==i){
                    System.out.println(i);
                }
            } else{
                System.out.println("输入错误");
            }
        }
    }
}

//乘法口诀表
class Test4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j+" * "+i+" = "+i*j+"\t");
            }
            System.out.println();
        }
    }
}

//输出整数的每一位
class Test5 {
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        int n = in.nextInt();
        while(n!=0){
            if(n>9) {
                System.out.print(n % 10 + ",");
            }else{
                System.out.println(n);
            }
            n/=10;
        }
    }
}

//模拟登录
class Test6 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int key=2022;
        int flag=0;
        int i=1;
        System.out.println("您有三次输入机会");
        while(i<=3){
            System.out.println("请输入您的密码");
            int input=in.nextInt();
            if(input==key){
                flag=1;
                System.out.println("登录成功");
                break;
            }
            i++;
        }
        if(flag==0){
            System.out.println("您已经用完三次机会，登陆失败");
        }
    }
}

//二进制序列
class Test7 {
    public static void main(String[] args) {
        int n=5;
        int n_keep=n;
        int i=32;
        System.out.println(n);
        System.out.println("奇数位");
        while(i>0){
            if((n&1)==1){
                System.out.print("1");
            }else{
                System.out.print("0");
            }
            n>>=2;
            i-=2;
        }
        System.out.println("\n偶数位");
        i=32;
        n_keep>>=1;
        while(i>0){
            if((n_keep&1)==1){
                System.out.print("1");
            }else{
                System.out.print("0");
            }
            n>>=2;
            i-=2;
        }
    }
}
